import React from 'react'
import './sidebar.css'

interface Props{
    isVisible:boolean;
    children:React.ReactNode
}
const sidebarComponent:React.FC<Props> = (props) => {
    const divStyle=(props:Props):React.CSSProperties=>({
        width:props.isVisible?"23rem":"0rem",
    })
    return (
        <div id="mySidenav" className='sidenav' style={divStyle(props)}>
            {props.children}
        </div>
    )
}

export default sidebarComponent
